<h1 class='center'>各種帳票出力</h1>
<br/><br/>
<center>
    <div style="width:800px">
        <table cellspacing='0' cellpadding='0' border='0' width='100%'>
            <tr>
                <td colspan='2' align='center' >
                    <p>Date: <input type="text" id="datepicker1" class='clsDatetime' readonly="readonly" value="{$firstDay}">　～　<input type="text"  value="{$lastDay}" id="datepicker2" class='clsDatetime' readonly="readonly"></p>
                </td>
            </tr>
            <tr><td><br/><br/></td><td><br/><br/></td></tr>        	
            <tr>
                <td align='left'>
                    <a class='button' id='frmShippingStoreFeePdf' href='/frmShippingStoreFeePdf?dateFrom={$firstDay}&dateTo={$lastDay}' link-fix='/frmShippingStoreFeePdf' target='_blank'>商品別入出庫料・保管料一覧　プレビュー</a>
                </td>
                <td align='right'>
                    <a class='button' id='frmShippingFeeListPdf' href='/frmShippingFeeListPdf?dateFrom={$firstDay}&dateTo={$lastDay}' link-fix='/frmShippingStoreFeePdf' target='_blank'>荷主別届先配送手数料　プレビュー</a>
                </td>
            </tr>
            <tr><td><br/><br/></td><td><br/><br/></td></tr>
            <!-- <tr>
                <td align='left'>
                    <a class='button' href='javascript:void(0)'>商品別入出庫料・保管料一覧　印刷</a>
                </td>
                <td align='right'>
                    <a class='button' href='javascript:void(0)'> 荷主別届先配送手数料　印刷</a>
                </td>
            </tr> -->
            <tr><td><br/><br/></td><td><br/><br/></td></tr>
            <tr>
                <td colspan='2' align='center'>
                    <a class='button' href='/ajax/frmDataImagePdf?dateFrom={$firstDay}&dateTo={$lastDay}' id='imagePdfExport' link-fix='/ajax/frmDataImagePdf' target='_blank'>メール添付用印刷イメージデータ作成</a>
                </td>
            </tr>
            <tr><td><br/><br/></td><td><br/><br/></td></tr>
            <tr>
                <td colspan='2' align='center'>
                    <b>選択</b>
                    <br/><br/>
                </td>
            </tr>
            <tr>
                <td colspan='2' align='center'>
                    荷主名
                    <select id="cboShipper">
                    	{foreach $shipper as $item}
                        	<option value="{$item['ShipperModel']['shipper_cd']}">{$item['ShipperModel']['shipper_cd']}&nbsp;|&nbsp;{$item['ShipperModel']['shipper_name']}</option>
                        {/foreach}
                    </select>
                </td>
            </tr>
             <tr><td><br/><br/></td><td><br/><br/></td></tr>
            <tr>
                <td align='left'>
                    <a id='shipping_store_list_preview' class='button' href="/frmDataImageImExInputPdf?SEQ={$firstId}&dateFrom={$firstDay}&dateTo={$lastDay}" link-fix='/frmDataImageImExInputPdf' target='_blank'>商品別入出庫料・保管料一覧　プレビュー</a>
                </td>
                <td align='right'>
                    <a id='shipping_fee_list_preview' class='button' href="/frmDataImageExInputPdf?SEQ={$firstId}&dateFrom={$firstDay}&dateTo={$lastDay}" link-fix='/frmDataImageExInputPdf' target='_blank'>荷主別届先配送手数料　プレビュー選択</a>
                </td>
            </tr>
            <tr><td><br/><br/></td><td><br/><br/></td></tr>
            <!-- <tr>
                <td align='left'>
                    <a class='button' href='javacript:void(0)'>商品別入出庫料・保管料一覧　印刷 </a>
                </td>
                <td align='right'>
                    <a class='button' href='javacript:void(0)'>荷主別届先配送手数料　印刷</a>
                </td>
            </tr> -->
            <tr><td><br/><br/></td><td><br/><br/></td>
            <tr>
                <td align='center' colspan='2'>
                    <a class='button' href='/ajax/shippingExcel?dateFrom={$firstDay}&dateTo={$lastDay}' link-fix='/ajax/shippingExcel' target='_blank' id='exportExcel1'>ＥＸＣＥＬデータ出力</a>
                </td>
            </tr>
            <tr><td><br/><br/></td><td><br/><br/></td>
            <tr>
                <td align='center' colspan='2'>
                    <a class='button' href='/'>ＭＮＵ_メインを戻る</a>
                </td>
            </tr>
        </table>
    </div>
</center>
 <script>
 
	$(function() {
		$( "#datepicker1" ).datepicker({
			dateFormat: 'yy-mm-dd',
	        onSelect: function( selectedDate ) {
	            $( "#datepicker2" ).datepicker( "option", "minDate", selectedDate );
	            
		  		 // no SEQ link
		         $oldHref = $('#frmShippingStoreFeePdf').attr('link-fix');
		         $subParam = 'dateFrom=' + $('#datepicker1').val() + '&dateTo=' + $('#datepicker2').val();
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#frmShippingStoreFeePdf').attr('href', $newHref);	        
		  		 // frmShippingFeeListPdf   
		         $oldHref = $('#frmShippingFeeListPdf').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#frmShippingFeeListPdf').attr('href', $newHref);	
		  		  // exportExcel1
		         $oldHref = $('#exportExcel1').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#exportExcel1').attr('href', $newHref);		  		 
		  		  
		  		  // pdfimage export
		         $oldHref = $('#imagePdfExport').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#imagePdfExport').attr('href', $newHref);			  		 
		  		 // shipping_store_list_preview		
		         $oldHref = $('#shipping_store_list_preview').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#shipping_store_list_preview').attr('href', $newHref + '&SEQ=' + $('#cboShipper').val());			  		 
		  		 // shipping_fee_list_preview  
		         $oldHref = $('#shipping_fee_list_preview').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#shipping_fee_list_preview').attr('href', $newHref + '&SEQ=' + $('#cboShipper').val());		  
		 	 
	        }			
		});
		$( "#datepicker2" ).datepicker({
			dateFormat: 'yy-mm-dd',
	        onSelect: function( selectedDate ) {
	            $( "#datepicker1" ).datepicker( "option", "maxDate", selectedDate );
		  		 // no SEQ link
		         $oldHref = $('#frmShippingStoreFeePdf').attr('link-fix');
		         $subParam = 'dateFrom=' + $('#datepicker1').val() + '&dateTo=' + $('#datepicker2').val();
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#frmShippingStoreFeePdf').attr('href', $newHref);
		  		 // frmShippingFeeListPdf   
		         $oldHref = $('#frmShippingFeeListPdf').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#frmShippingFeeListPdf').attr('href', $newHref);		
		  		  // exportExcel1
		         $oldHref = $('#exportExcel1').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#exportExcel1').attr('href', $newHref);		
		  		// pdfimage export
		         $oldHref = $('#imagePdfExport').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#imagePdfExport').attr('href', $newHref);		  		 
		  		 // shipping_store_list_preview		
		         $oldHref = $('#shipping_store_list_preview').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#shipping_store_list_preview').attr('href', $newHref + '&SEQ=' + $('#cboShipper').val());			  		 
		  		 // shipping_fee_list_preview  
		         $oldHref = $('#shipping_fee_list_preview').attr('link-fix');
		  		 $newHref = $oldHref + '?' + $subParam;
		  		 $('#shipping_fee_list_preview').attr('href', $newHref + '&SEQ=' + $('#cboShipper').val());		 		  		 	  		 
	        }				
		});		
	});
</script>